package com.gagakuai.bpm.common.enums;

public enum WithDrawEnum {

    TASK_EMPTY(1, "没有查到任务"),

    TASK_START_USER(2, "只有发起人才能取回"),

    TASK_ACTIVITY_EMPTY(3, "流程节点为空"),

    UNKNOWN(4, "未知情况"),

    PROCESS_INSTANCE_EMPTY(5, "流程实例为空"),

    PROCESS_INSTANCE_ENDED(6, "流程实例结束"),


    PROCESS_STARTER(8, "只有流程发起人才能操作"),
    ;

    public int code;

    public String msg;

    public static String getMsgByCode(int code){
        for (WithDrawEnum value : WithDrawEnum.values()) {
            if(value.code == code){
                return value.msg;
            }
        }

        return null;
    }

    WithDrawEnum(int code, String msg){
        this.code = code;
        this.msg = msg;
    }
}
